import request from '@/utils/request';

/**
 * 模型新建分组
 */
export const modelGroupAdd = (data) => {
  return request({ url: `/business/cmdb/classification`, method: 'post', data });
};

/**
 * 模型编辑分组
 */
export const modelGroupEdit = (data) => {
  return request({ url: `/business/cmdb/classification`, method: 'put', data });
};

/**
 * 模型删除分组
 */
export const modelGroupDel = (data) => {
  return request({ url: `/business/cmdb/classification/${data}`, method: 'delete' });
};

/**
 * 模型查询分组
 */
export const modelGroupList = (params) => {
  return request({ url: `/business/cmdb/classification/page`, method: 'get', params });
};

/* 新建模型 */

export const modelAdd = (data) => {
  return request({ url: '/business/cmdb/example', method: 'post', data });
};

/* 编辑模型 */

export const modelEdit = (data) => {
  return request({ url: '/business/cmdb/example', method: 'put', data });
};

/**
 * 删除模型
 */
export const modelDel = (data) => {
  return request({ url: `/business/cmdb/example/${data}`, method: 'delete' });
};

/* 新增模型抽屉中  模型详情 */
export const modelDetailList = (data) => {
  return request({ url: `/business/cmdb/example/${data}`, method: 'get' });
};

/* 新增模型抽屉中  分组 */

export const modelDetailGroupAdd = (data) => {
  return request({ url: '/business/cmdb/examplegroup', method: 'post', data });
};
/* 编辑模型抽屉中  分组 */

export const modelDetailGroupEdit = (data) => {
  return request({ url: '/business/cmdb/examplegroup', method: 'put', data });
};
/* 删除模型抽屉中  分组 */

export const modelDetailGroupDel = (data) => {
  return request({ url: `/business/cmdb/examplegroup/${data}`, method: 'delete' });
};

/* 新增模型抽屉中  字段 */

export const modelDetailKeyAdd = (data) => {
  return request({ url: '/business/cmdb/column', method: 'post', data });
};
/* 修改 模型抽屉中  字段 */
export const modelDetailKeyEdit = (data) => {
  return request({ url: '/business/cmdb/column', method: 'put', data });
};

/* 删除 模型抽屉中  字段 */
export const modelDetailKeyDel = (data) => {
  return request({ url: '/business/cmdb/column/'+data, method: 'delete' });
};




/* 模型资产 详情里面的列表 ***************************************************************************************************** 资产 */

export const propertyDetailList = (data) => {
  return request({ url: `/business/cmdb/asset/page`, method: 'post' ,data:data});
};
/* 新增 */
export const propertyDetailAdd = (data) => {
  return request({ url: `/business/cmdb/asset`, method: 'post' ,data:data});
};
/* 修改 */
export const propertyDetailEdit = (data) => {
  return request({ url: `/business/cmdb/asset`, method: 'put' ,data:data});
};
/* 删除 */
export const propertyDetailDel = (data) => {
  return request({ url: `/business/cmdb/asset/${data}`, method: 'delete' });
};

/* 根据cme_key查询所有字段   */
export const propertyKeylList = (data) => {
  return request({ url: `/business/cmdb/column/columns/${data}`, method: 'get' });
};


/* 是否监控 */

export const serviceIsMonitoring = (data) => {
  return request({ url: `/listener/server/openMonitor`, method: 'post',data });
};
  


/* 获取IP树形 */
export const freeIpListTree = async(data) => {
  return request({ url: `/whiteIp/freeIpList`, method: 'get',data });
};
  
